/**
 * @description vue的配置文件
 * @author ymd
 */
const path = require('path')

module.exports = {
  configureWebpack: {
    resolve: {
      alias: {
        api: path.resolve(__dirname, 'src/api'),
        assets: path.resolve(__dirname, 'src/assets'),
        components: path.resolve(__dirname, 'src/components'),
        config: path.resolve(__dirname, 'src/config'),
        icons: path.resolve(__dirname, 'src/icons'),
        lang: path.resolve(__dirname, 'src/lang'),
        router: path.resolve(__dirname, 'src/router'),
        utils: path.resolve(__dirname, 'src/utils'),
        styles: path.resolve(__dirname, 'src/styles'),
        views: path.resolve(__dirname, 'src/views'),
        store: path.resolve(__dirname, 'src/store')
      }
    }
  },
  devServer: {
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:3000/api',
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  }
}
